﻿using System;
using System.Text;

namespace CommonUtils.CodeFactory
{
    public static class TestCase
    {
        /// <summary>
        /// 生成Switch-Case
        /// </summary>
        [Obsolete("Tab键可以自动生成")]
        public static string GenerateCasesOfSwitch()
        {
            var type = typeof(TestModel);
            var sb = new StringBuilder();
            foreach (var pro in type.GetProperties())
                sb.AppendLine("case \"{0}\":\r\nreturn \"{1}\";\r\n", pro.PropertyType, pro.Name.Replace('_', '?').Replace("Array", "[]"));
            return sb.ToString();
        }
    }
}
